package com.zjj.learn.designmodel.principles.demo3.after;




/**
 * @ClassName: ComputerDemo
 * @Description:
 */
public class ComputerDemo2 {
    public static void main(String[] args) {
        //创建组件对象
        HardDisk hardDisk = new XiJieHardDisk();
       // CPU cpu = new IntelCPU();
        CPU cpu = new AMDCPU();
        Memory memory = new KingstonMemory();

        //创建计算机对象
        Computer c = new Computer();
        //组装计算机
        c.setCpu(cpu);
        c.setHardDisk(hardDisk);
        c.setMemory(memory);

        //运行计算机
        c.run();
    }
}
